1. Field of the Invention
The present invention relates to an image processing method, an apparatus and a storage medium.
2. Related Background Art
A conventional method of cutting out a specific object from an image includes; a method comprising selecting an area having a color component value (or a shading value) of a predetermined range including a pixel value of an object designated by a user or a point on background, and repeatedly removing the background or designating the area of an extraction object; a method comprising designating a rough outline area or a local area including the outline of an extraction object, and forming fine lines or clustering in the designated area to obtain and cut out an object border outline; and the like.
Moreover, a method is also known which comprises using only the color component only to set a closed curve (or the borderline of a polygon) so that the image part of the extraction object is roughly surrounded, and generating a cut out mask image with a shape substantially close to the shape of the extraction object.
Furthermore, also known is a method in which an input image is divided into areas having similar colors or areas having similar space frequencies, and a user performs an operation of selecting an image area constituted of an area to be extracted from the divided areas to extract a desired object image.
In contrast to these methods, a method is known which comprises generating an initial closed curve inside the extraction object, performing an expansion processing of the closed curve to move a sampling point position linearly outward to an edge or another characteristic point position in a radial direction passed through a sampling point on the closed curve from a central point, and determining the shape of the extraction object.
In the method of selecting the area having the color component value of the predetermined range while designating the area of the extraction object, when the object is constituted of the areas locally having a large number of color components, or when the border of the background and the object has a low contrast and cannot easily be distinguished only with a pixel property, a very large number of labors (the designation of a color component selection range, point designation in the extraction object, and the like) are required. Moreover, even when the operating property is enhanced by disposing means for arbitrarily changing the size of the extraction area, it is difficult in principle to distinguish the background from the object to be extracted only with the shading value for extraction.
In the method of designating the rough outline including the outline of the extraction object, when the width of the rough outline is small, the rough outline has to be set with considerable attention so that the outline does not deviate from a true outline. Moreover, with a large width of rough outline, even by forming the fine lines or clustering to obtain the extraction object outline, when the border of the extraction object has a low contrast, and when the object outline in the rough outline has a complicated shape, it is difficult to extract the true outline. Even in the method of designating the local area, performing the area division or the border determination in the area, moving the local area so as to trace the extraction object outline and successively extracting the borderline, the considerable attention and labors are required for the user""s operation.
For the method of designating the closed curve roughly surrounding (the area roughly including) the image part of the extraction object, even in a system based on the ratio of the area having the sale color component as that included in the closed curve, when there is an area having the same color as that of the object in the background in the closed curve, and when the closed curve area has double or more area as compared with the area to be cut out, there is a problem that wrong extraction is easily caused, for example, a background part is extracted.
In the method in which the user selects the area to be extracted from the results obtained beforehand by performing the area division by the color component and the area division based on the space frequency component, when the optimum area division is not performed, the number of small divided areas belonging to the area to be extracted increases, thereby increasing the labor of selection by the user. When the borderline of the area division does not meet the extraction object outline, much labor for repair is required. Moreover, since the operation is performed on the entire image, in some cases, the processing load is unnecessarily excessively enlarged by the originally unnecessary area division in the background part, and the result cannot be obtained at a high speed.
Moreover, in the system premising the extraction object recognition processing or the outline recognition processing, in the present situation it is usually difficult to recognize the extraction object or the outline. For example, since there are prerequisites that the extraction can be recognized based on the specific color component, no object outline other than the outline of the extraction object is present in the closed curve, and that the outline can be recognized otherwise, the system has no general-purpose property, and is difficult to use.
The method of expanding the closed curve inside the extraction object to divide the area is performed at a high speed, but usually a large number of closed curves need to be set in appropriate positions inside the extraction object area. It is difficult to automate the closed curve setting, while manual setting vainly increases labors.
An object of the present invention is to provide an image processing method, an apparatus and a storage medium which solve the above-described disadvantages.
To attain the above-described object, according to one preferred embodiment of the present invention, a core designated by at least one of a predetermined point, line segment and area is set in an image, an evaluation function including a texture characteristic amount is calculated in a local area constituted of at least one standard point constituting the core, and the shape of the core is renewed based on the value of the evaluation function to determine the borderline of a predetermined area in the image.
Moreover, to achieve the above-described object, according to one preferred embodiment of the present invention, there is provided an image extracting method comprising: a core setting step of setting a core designated by at least one of a predetermined point, line segment and area in an image; a standard point setting step of setting a representative point set on the core as a standard point; a similarity calculating step of obtaining a similarity of a neighborhood area image of the standard point and a neighborhood area image of an attention point based on a characteristic amount distance obtained by weighting and adding a first distance between two points in a characteristic space based on a color component characteristic amount with respect to the attention point given in a predetermined method and the standard point, and a second distance between the two points in the characteristic space based on a texture characteristic amount; an extraction area renewing step of combining the attention point or the neighborhood area with a predetermined extraction area including the standard point when the similarity is larger than a predetermined threshold value, or removing the attention point or the neighborhood area from the extraction area when the similarity is equal to or less than the threshold value and when the attention point is included in the extraction area, to renew a borderline of the extraction area; and a borderline display step of displaying the renewed borderline of the extraction area.
Furthermore, to achieve the above-described object, one preferred embodiment of the present invention comprises: an initial outline setting step of setting an initial outline present inside or outside an object to be extracted; a standard point setting step of setting a plurality of predetermined representative points set on the initial outline as standard points; a similarity calculating step of obtaining a similarity of a neighborhood area image of the standard point and a neighborhood area image of an attention point based on a characteristic amount distance obtained by weighting and adding a first distance between two points in a characteristic space based on a color component characteristic amount with respect to the attention point given in a predetermined method and the standard point and a second distance between the two points in the characteristic space based on a texture characteristic amount; an extraction area renewing step of combining the attention point or the neighborhood area with a predetermined extraction area including the standard point when the similarity is larger than a predetermined threshold value, or removing the attention point or the neighborhood area from the extraction area when the similarity is equal to or less than the threshold value and when the attention point is included in the extraction area, to renew a borderline of the extraction area a predetermined number of times; and a threshold value setting step of determining the threshold value based on an edge ratio on an inner borderline of the renewed extraction area when the entire initial outline is present outside the object, or determining the threshold value based on the edge ratio on an outer borderline of the renewed extraction area when the entire initial outline is present inside the object.
Additionally, to achieve the above-described object, one preferred embodiment of the present invention comprises an initial outline setting step (unit) of setting an initial outline having an arbitrary shape outside or inside a predetermined object area in an image; a characteristic amount extracting step (unit) of extracting a first characteristic amount from the image; a modifying step (unit) of modifying the initial outline based on the first characteristic amount and a first threshold value processing; a convergence determining step (unit) of extracting a second characteristic amount at a predetermined sampling point on the modified outline, and determining convergence of the outline by a second threshold value processing of a predetermined evaluation function value concerning the second characteristic amount; and a threshold value renewing step (unit) of renewing a threshold value in the first threshold value processing.
The present invention relates to an image processing apparatus, an image processing method, and a storage medium which have inventive functions.